package com.zh.common;

public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id); //设置值
    }

    public static Long getCurrentId() {
        return threadLocal.get(); //获取值
    }

    public static void removeCurrentId() {
        threadLocal.remove(); //移除键值，防止内存泄漏
    }
}
